<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旅行助手 - 智能行程规划</title>
    <link rel="stylesheet" href="styles.css">
    <script src="https://webapi.amap.com/loader.js"></script>
</head>
<body>
    <!-- 登录界面 -->
    <div id="login-container" class="container">
        <div class="login-form">
            <h1>旅行助手</h1>
            <div class="form-tabs">
                <button class="tab-btn active" onclick="showTab('login', event)">登录</button>
                <button class="tab-btn" onclick="showTab('register', event)">注册</button>
            </div>
            
            <!-- 登录表单 -->
            <div id="login-tab" class="tab-content active">
                <form id="login-form">
                    <div class="form-group">
                        <input type="text" id="login-userId" placeholder="账号（11位）" required>
                    </div>
                    <div class="form-group">
                        <input type="password" id="login-password" placeholder="密码（至少6位）" required>
                    </div>
                    <button type="submit" class="btn-primary">登录</button>
                </form>
            </div>
            
            <!-- 注册表单 -->
            <div id="register-tab" class="tab-content">
                <form id="register-form">
                    <div class="form-group">
                        <input type="text" id="register-userName" placeholder="用户名" required>
                    </div>
                    <div class="form-group">
                        <input type="text" id="register-userId" placeholder="账号（11位）" required>
                    </div>
                    <div class="form-group">
                        <input type="password" id="register-password" placeholder="密码（至少6位）" required>
                    </div>
                    <button type="submit" class="btn-primary">注册</button>
                </form>
            </div>
        </div>
    </div>

    <!-- 主界面 -->
    <div id="main-container" class="container hidden">
        <!-- 顶部导航栏 -->
        <header class="header">
            <div class="user-info">
                <span id="user-name">用户</span>
                <span id="user-id" class="user-id">(账号)</span>
            </div>
            
            <!-- 功能按钮区域 -->
            <div class="function-buttons">
                <div class="voice-btn-container">
                    <button id="voice-plan-btn" class="voice-btn">
                        <div class="btn-icon">🎤</div>
                        <div class="btn-text">智能行程规划</div>
                        <div class="voice-indicator">按住说话</div>
                    </button>
                    <button id="voice-budget-btn" class="voice-btn">
                        <div class="btn-icon">🎤</div>
                        <div class="btn-text">费用预算分析</div>
                        <div class="voice-indicator">按住说话</div>
                    </button>
                </div>
            </div>
            
            <button id="logout-btn" class="btn-secondary">退出</button>
        </header>

        <!-- 主要内容区域 -->
        <div class="main-content">
            <!-- 左侧导航栏 -->
            <nav class="sidebar">
                <ul class="nav-menu">
                    <li><a href="#" class="nav-item active" data-section="travel-plans">旅行计划</a></li>
                    <li><a href="#" class="nav-item" data-section="budget-analysis">费用预算分析</a></li>
                    <li><a href="#" class="nav-item" data-section="amap">高德地图</a></li>
                    <li><a href="#" class="nav-item" data-section="universal-assistant">万能助手</a></li>
                </ul>
                
                <!-- 路线规划结果区域 -->
                <div id="route-results-sidebar" class="route-results-sidebar hidden">
                    <div id="sidebar-route-info" class="route-info">
                        <!-- 路线规划结果将在这里显示 -->
                    </div>
                    <div class="route-actions">
                        <button id="sidebar-clear-route" class="btn-secondary">清除路线</button>
                        <button id="sidebar-show-route-panel" class="btn-primary">显示路线面板</button>
                    </div>
                </div>
            </nav>

            <!-- 右侧内容区域 -->
            <main class="content-area">
                <!-- 旅行计划模块 -->
                <section id="travel-plans" class="content-section active">
                    <div class="section-header">
                        <h2>旅行计划</h2>
                        <button id="refresh-travel-plans" class="btn-secondary">刷新</button>
                    </div>
                    <div id="travel-plans-list" class="list-container">
                        <!-- 旅行计划列表将在这里动态加载 -->
                    </div>
                </section>

                <!-- 费用预算分析模块 -->
                <section id="budget-analysis" class="content-section">
                    <div class="section-header">
                        <h2>费用预算分析</h2>
                        <button id="refresh-budget-analysis" class="btn-secondary">刷新</button>
                    </div>
                    <div id="budget-analysis-list" class="list-container">
                        <!-- 费用预算分析列表将在这里动态加载 -->
                    </div>
                </section>

                <!-- 高德地图模块 -->
                <section id="amap" class="content-section">
                    <div class="section-header">
                        <h2>高德地图</h2>
                        <div class="map-controls">
                            <button id="locate-me" class="btn-primary">定位我的位置</button>
                            <button id="route-planning-btn" class="btn-primary">路线规划</button>
                            <button id="reset-map" class="btn-secondary">重置地图</button>
                        </div>
                    </div>
                    
                    <!-- 路线规划面板 -->
                    <div id="route-planning-panel" class="route-panel hidden">
                        <div class="route-header">
                            <h3>路线规划</h3>
                            <button id="close-route-panel" class="close-btn">&times;</button>
                        </div>
                        <div class="route-form">
                            <div class="form-group">
                                <label for="start-point">起点：</label>
                                <input type="text" id="start-point" placeholder="输入起点地址">
                            </div>
                            <div class="form-group">
                                <label for="end-point">终点：</label>
                                <input type="text" id="end-point" placeholder="输入终点地址">
                            </div>
                            <button id="search-route" class="btn-primary">搜索路线</button>
                            <button id="clear-route" class="btn-secondary">清除路线</button>
                        </div>
                        <div id="route-results" class="route-results">
                            <div id="route-panel" class="route-panel-content">
                                <!-- 路线规划结果将在这里显示 -->
                            </div>
                        </div>
                    </div>
                    
                    <div id="map-container" class="map-container">
                        <!-- 高德地图将在这里显示 -->
                        <div id="map-loading" class="map-loading">
                            <div class="loading-spinner"></div>
                            <p>地图加载中...</p>
                        </div>
                        <div id="map" style="width: 100%; height: 100%;"></div>
                    </div>
                    <div id="location-info" class="location-info">
                        <p>当前位置：<span id="current-location">未获取位置信息</span></p>
                    </div>
                </section>

                <!-- 万能助手模块 -->
                <section id="universal-assistant" class="content-section">
                    <div class="section-header">
                        <h2>万能助手</h2>
                    </div>
                    <div class="assistant-container">
                        <div class="assistant-welcome">
                            <h3>我是一个万能助手，你可以问我任何问题</h3>
                        </div>
                        
                        <div class="assistant-input-area">
                            <textarea id="question-input" placeholder="请输入您的问题..." rows="4"></textarea>
                            <button id="send-question" class="btn-primary">发送</button>
                        </div>
                        
                        <div id="assistant-loading" class="assistant-loading hidden">
                            <div class="loading-spinner"></div>
                            <p>正在分析您的问题，请稍候...</p>
                        </div>
                        
                        <div id="assistant-response" class="assistant-response hidden">
                            <div class="response-header">
                                <h4>助手回复</h4>
                                <button id="clear-response" class="btn-secondary">清除</button>
                            </div>
                            <div id="response-content" class="response-content"></div>
                        </div>
                        
                        <div id="assistant-history" class="assistant-history hidden">
                            <div class="history-header">
                                <h4>历史对话</h4>
                                <button id="clear-history" class="btn-secondary">清除历史</button>
                            </div>
                            <div id="history-list" class="history-list"></div>
                        </div>
                    </div>
                </section>
            </main>
        </div>


    </div>

    <!-- 模态框 -->
    <div id="modal" class="modal hidden">
        <div class="modal-content">
            <div class="modal-header">
                <h3 id="modal-title">详情</h3>
                <button id="close-modal" class="close-btn">&times;</button>
            </div>
            <div class="modal-body">
                <div id="modal-content">
                    <!-- 模态框内容将在这里动态加载 -->
                </div>
            </div>
        </div>
    </div>

    <!-- 语音输入模态框 -->
    <div id="voice-modal" class="modal hidden">
        <div class="modal-content voice-modal">
            <div class="modal-header">
                <h3 id="voice-modal-title">语音输入</h3>
                <button id="close-voice-modal" class="close-btn">&times;</button>
            </div>
            <div class="modal-body">
                <div class="voice-input-area">
                    <div id="voice-status" class="voice-status">准备录音...</div>
                    <div id="voice-wave" class="voice-wave"></div>
                    <div id="voice-text" class="voice-text"></div>
                </div>
                <div class="voice-actions">
                    <button id="start-recording" class="btn-primary">开始录音</button>
                    <button id="stop-recording" class="btn-secondary hidden">停止录音</button>
                    <button id="submit-voice" class="btn-primary hidden">提交</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 高德地图API -->
        <script src="script.js"></script>
    </body>
</html>